<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <!-- Bootstrap core CSS -->
    <link href="webjars/bootstrap/4.6.2/css/bootstrap.min.css" rel="stylesheet">

    <!-- Custom styles for this template -->
    <link href="/css/dashboard.css" rel="stylesheet">
</head>

<nav id="sidebarMenu" class="col-md-3 col-lg-2 d-md-block bg-light sidebar collapse">
    <div class="sidebar-sticky pt-3">
        <ul class="nav flex-column">
            <li class="nav-item">
                <a class="nav-link" href="/me">
                    <span data-feather="users"></span>
                    Me
                </a>
            </li>
            <li class="nav-item">
                <a class="nav-link" href="/cars">
                    <span data-feather="shopping-cart"></span>
                    Cars
                </a>
            </li>
            <li class="nav-item">
                <a class="nav-link" href="/orders">
                    <span data-feather="file"></span>
                    Orders
                </a>
            </li>
        </ul>

        <h6 class="sidebar-heading d-flex justify-content-between align-items-center px-3 mt-4 mb-1 text-muted" th:if="${session.user.role} eq 'admin'">
            <span>Manager Operation</span>
            <a class="d-flex align-items-center text-muted" href="#" aria-label="Add a new report">
                <span data-feather="plus-circle"></span>
            </a>
        </h6>
        <ul class="nav flex-column mb-2" th:if="${session.user.role} eq 'admin'">
            <li class="nav-item">
                <a class="nav-link" href="/users">
                    <span data-feather="users"></span>
                    Users
                </a>
            </li>
            <li class="nav-item">
                <a class="nav-link" href="/orders_admin">
                    <span data-feather="file-text"></span>
                    Orders
                </a>
            </li>
            <li class="nav-item">
                <a class="nav-link" href="/cars_admin">
                    <span data-feather="file-text"></span>
                    Cars
                </a>
            </li>
            <li class="nav-item">
                <a class="nav-link" href="/dashboard">
                    <span data-feather="file-text"></span>
                    Statistics
                </a>
            </li>
        </ul>
    </div>
</nav>

<nav id="headerMenu" class="navbar navbar-dark sticky-top bg-dark flex-md-nowrap p-0 shadow">
    <a class="navbar-brand col-md-3 col-lg-2 mr-0 px-3" href="/">XJTLU ZPCR</a>
    <button class="navbar-toggler position-absolute d-md-none collapsed" type="button" data-toggle="collapse" data-target="#sidebarMenu" aria-controls="sidebarMenu" aria-expanded="false" aria-label="Toggle navigation">
        <span class="navbar-toggler-icon"></span>
    </button>
    <input class="form-control form-control-dark w-100" type="text" placeholder="Search" aria-label="Search">
    <ul class="navbar-nav px-3">
        <li class="nav-item text-nowrap">
            <a class="nav-link" href="/login/logout" th:if="${session.user ne null}">Log out</a>
            <a class="nav-link" href="/login" th:if="${session.user eq null}">Log in</a>
        </li>
    </ul>
</nav>
</html>